import http from './request'

//属性列表或参数列表 
export const productAttributeList = (params: IProductAttrListParams): RES<IAdvertiseListModel> => http.get(`/productAttribute/list/${params.cid}`, { params })

//所有商品属性列表 
export const productAttributeAll = (params: IadminList): RES<IProductAttrModel> => http.get(`/productAttribute/category/list`, { params })

//添加商品属性 
export const productAttributeCreate = (params: IProductAttrList): RES<number> => http.post(`/productAttribute/create`, params)

//批量删除商品属性 
export const productAttributeDelete = (ids: number[]): RES<number> => http.post(`/productAttribute/delete?ids=${ids}`)

//根据id获取单个商品出现 
export const getProductAttributeId = (id: number): RES<IProductAttrList> => http.get(`/productAttribute/${id}`)

//修改商品属性 /productAttribute/update/{id}
export const productAttributeUpdate = (params: IProductAttrList): RES<number> => http.post(`/productAttribute/update/${params.id}`, params)